import { createStore } from "vuex"
import cart from './modules/cart.js'
import homes from './modules/home.js'
export default createStore({
	state:()=>{
		return {
			uid:'',
			name:'未登录',
			home:'未设置',
			token:'',
			img:'',
			good:[],
			price:'0',
			addr:{},
		}
		
	},
	mutations:{
		update_uid(state,payload){
			state.uid = payload
		},
		update_name(state,payload){
			state.name = payload
		},
		update_home(state,payload){
			state.home = payload
		},
		update_token(state,payload){
			state.token = payload
		},
		update_img(state,payload){
			state.img = payload
		},
		// 订单携带
		update_good(state,payload){
			state.good = payload
		},
		//数量
		update_price(state,payload){
			state.price = payload
		},
		update_addr(state,payload){
			state.addr = payload
		},

	},

	modules:{
		cart
	}
})

